




/**************************************************************************************************
Analysis for Martini, C. A. and Uruena, V. (2024) Can role models influence female's decision to participate 
in the labor market? Evidence from a field experiment
**************************************************************************************************/





{/* Description of main variables, the remaining variables can be found in the codebook 

treatment				0 Placebo video, 1 Woman video, 2 Man video
woman_video				0 Placebo video, 1 Woman video
man_video				0 Placebo video, 1 Man video
complete_app 			1 if student handed in a complete application either for the coordinator or the assistant position, 0 if student did not apply
applied_assistant 		1 if student applied to the assistant position, 0 if student did not apply
applied_coordinator		1 if student applied to the coordinator position, 0 if student did not apply
female					1 if the student is female, 0 if the student is male

*/	
}


*set directory and global for directory:

global Directory "/Users/..../Replication/"


{ /* Sample & Additional variables*/


use "${Directory}/Data/processed/school_final.dta", clear 

*sample:
gen sample = 1 if !missing(female, age, science_focus, no_brothers, economic_status, job_present, ///
 						   vanilla_family, friends, ptask_1, ptask_2, perf_diff21, gender_imb, decision_3, ///
						   belief_rank_2, decision_4, decision_5, belief_2, meeting_outsiders, identify_character, ///
						   like_character, future_character, risk_character, success_character, know_character, ///
						   smartphone_use)
						   
						   
*interactions:
gen fem_woman_video = woman_video*female 
label var fem_woman_video  "Woman video x Female"

gen fem_man_video = man_video*female
label var fem_man_video  "Man video x Female"


gen male_woman_video = woman_video*male 
label var male_woman_video "Woman video x Male"

gen male_man_video =  man_video*male						   
label var male_man_video "Man video x Male"

}






*  ====== Table 1: Summary Statistics  ====== 

local summary female age science_focus no_brothers economic_status job_present ///
	vanilla_family friends ///
	meeting_outsiders  smartphone_use city_raised education_mother 

orth_out `summary' using "${Directory}Output/SummaryStatistics.tex" if sample==1, by(treatment) ///
test se count latex full title(Summary Statistics) ///
armlabel("Placebo" "Woman Video" "Man Video") replace  ///	
	

	
* ====== Table 2: Treatment Effects on Applications  ======  

global treatments woman_video man_video

global interactions fem_woman_video fem_man_video male_woman_video male_man_video

global controls age science_focus no_brothers economic_status job_present vanilla_family friends meeting_outsiders smartphone_use education_mother gender_imb



* Complete Applications

eststo app1: reg complete_app $interactions i.female ///
	i.city if sample == 1, cl(treat_sess)
estadd local fe "Yes"
estadd local con "No"	

test fem_man_video = fem_woman_video = male_man_video = male_woman_video



eststo app2: reg complete_app $interactions i.female $controls ///
	i.city if sample == 1, cl(treat_sess)
estadd local fe "Yes"
estadd local con "Yes"

test fem_man_video = fem_woman_video = male_man_video = male_woman_video


*control group means:
ttest complete_app if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest complete_app if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)


* Applied to Coordinator


eststo app4: reg applied_coordinator $interactions i.female ///
	i.city if sample == 1, cl(treat_sess)
estadd local fe "Yes"
estadd local con "No"	

test fem_man_video = fem_woman_video = male_man_video = male_woman_video


eststo app5: reg applied_coordinator $interactions i.female $controls ///
	i.city if sample == 1, cl(treat_sess)
estadd local fe "Yes"
estadd local con "Yes"	

test fem_man_video = fem_woman_video = male_man_video = male_woman_video


*control group means:
ttest applied_coordinator if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest applied_coordinator if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)


esttab  app1 app2 app4 app5  using "${Directory}Output/Labour_regressions_OLS.tex", ///
replace label cells(b(fmt(3) star) se(par fmt(3))) ///
mgroups("Completed Application" "Coordinator Position" , pattern(1 0  1 0 )   erepeat(\cmidrule(lr){@span}) span prefix(\multicolumn{@span}{c}{) suffix(})) ///
scalars("fe Fixed effects" "con Controls")  collabels(none) star(* 0.10 ** 0.05 *** 0.01) ///
varwidth(10) nogaps type style(tex) modelwidth(11) compress nobase nomtitles ///
drop(*.city age science_focus no_brothers economic_status job_present vanilla_family friends meeting_outsiders smartphone_use education_mother gender_imb )


	

* ====== Table 3: Treatment Effects on Performance and Competitive Preferences	====== 
	

	
eststo task1: reg ptask_1 $interactions i.female  gender_imb age science_focus no_brothers vanilla_family friends meeting_outsiders smartphone_use ///
	i.city if sample==1, cl(treat_sess)
test fem_man_video = fem_woman_video = male_man_video = male_woman_video
//p-value = 0.011	
*control group means:
ttest ptask_1 if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest ptask_1 if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)


eststo task2: reg ptask_2 $interactions i.female  perf_diff21 gender_imb age science_focus no_brothers vanilla_family friends meeting_outsiders smartphone_use ///
	i.city if sample==1, cl(treat_sess)
test fem_man_video = fem_woman_video = male_man_video = male_woman_video	
//p-value = 0.010
*control group means:
ttest ptask_2 if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest ptask_2 if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)


eststo dec3: reg decision_3 $interactions i.female  ptask_2 perf_diff21 belief_rank_2 gender_imb age science_focus no_brothers vanilla_family friends meeting_outsiders smartphone_use ///
	i.city if sample==1, cl(treat_sess)	
test fem_man_video = fem_woman_video = male_man_video = male_woman_video	
//p-value = 0.090
*control group means:
ttest decision_3 if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest decision_3 if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)


eststo dec5: reg decision_5 $interactions i.female  ptask_2 perf_diff21 belief_2 gender_imb age science_focus no_brothers vanilla_family  friends meeting_outsiders smartphone_use ///
	i.city if sample==1, cl(treat_sess)
test fem_man_video = fem_woman_video = male_man_video = male_woman_video		
//p-value = 0.127
*control group means:
ttest decision_5 if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest decision_5 if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)



esttab  task1 task2 dec3 dec5 using "${Directory}/Output/treat_lab_comp.tex", ///
replace label r2 cells(b(fmt(3) star) se(par fmt(3))) ///
collabels(none) star(* 0.10 ** 0.05 *** 0.01) ///
varwidth(10) nogaps type style(tex) modelwidth(11) compress nobase ///
drop(*.city ptask_2 perf_diff21 belief_2 belief_rank_2  gender_imb age science_focus no_brothers vanilla_family  friends meeting_outsiders smartphone_use)

	
	

* ====== Table 4: Treatment Effects on Aspirations and Beliefs ======



label var asp_index95 "Asp. Index"
label var locus_control "Locus of C."
label var sefficacy_academic "Academic SE"
label var general_sefficacy "General SE"
label var current_index "Current Index"

*aspiration index
//using the placebo mean and sd for standardization (95% percentile is put as missing)
eststo aspindex: regress asp_index95 $interactions i.female current_index $controls ///
	i.city if sample==1, cl(treat_sess) 
test fem_man_video = fem_woman_video = male_man_video = male_woman_video	

*control group means:
ttest asp_index95 if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest asp_index95 if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)

*locus of control
eststo locus: regress locus_control $interactions i.female $controls ///
	i.city if sample==1, cl(treat_sess)
test fem_man_video = fem_woman_video = male_man_video = male_woman_video	

*control group means:
ttest locus_control if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest locus_control if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)

*general self-efficacy	
eststo gen: regress general_sefficacy $interactions i.female $controls ///
	i.city if sample==1, cl(treat_sess)
test fem_man_video = fem_woman_video = male_man_video = male_woman_video	

*control group means:
ttest general_sefficacy if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest general_sefficacy if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)

*academic self-efficacy
eststo academic: regress sefficacy_academic $interactions i.female $controls ///
	i.city if sample==1, cl(treat_sess)
test fem_man_video = fem_woman_video = male_man_video = male_woman_video	

*control group means:
ttest sefficacy_academic if sample == 1 & female == 1 & (treatment == 0|treatment ==1), by(treatment)
ttest sefficacy_academic if sample == 1 & female == 0 & (treatment == 0|treatment ==1), by(treatment)

esttab aspindex  locus  gen  academic  using "${Directory}Output/treat_asp&belief.tex", ///
replace label r2 cells(b(fmt(3) star) se(par fmt(3))) ///
collabels(none) star(* 0.10 ** 0.05 *** 0.01) ///
varwidth(10) nogaps type style(tex) modelwidth(11) compress nobase ///
drop(*.city current_index age science_focus no_brothers economic_status job_present vanilla_family friends meeting_outsiders smartphone_use education_mother gender_imb)





*  ====== Figure 1: Treatment Effects on Applications by Gender  ====== 


cibar complete_app if sample==1, over(female treatment) barcol(gs8 gs10 gs13) barlabel(on) blf(%9.2f)  ///
graphopts(ylabel(0.0(0.1)0.7)  ytitle("Completed An Application") graphregion(color(white)) legend(rows(1))) ///
ciopts(lcolor(gs0)) blsize(small) bargap(5)  
graph export ${Directory}Output/Applied_AnyPosition.png, as(png) replace
graph export ${Directory}Output/Applied_AnyPosition.eps, as(eps) replace


cibar applied_coordinator if sample==1, over(female treatment) barcol(gs8 gs13) barlabel(on) blf(%9.2f)  ///
graphopts(ylabel(0.2(0.1)0.6)  ytitle("Applied to Coordinator Position") graphregion(color(white)) legend(rows(1))) ///
ciopts(lcolor(gs0)) blsize(small) bargap(5)  
graph export ${Directory}Output/Applied_Coordinator.png, as(png) replace
graph export ${Directory}Output/Applied_Coordinator.eps, as(eps) replace



* APPENDIX



	
* ====== Table A1: Rating of the Role Model ======


orth_out risk_character success_character like_character identify_character  ///
future_character if female == 1 & sample == 1 using "${Directory}Output/character_rating_female.tex", by(treatment) ///
pcompare latex se count notes(Standard errors clustered at the treatment level.)


orth_out risk_character success_character like_character identify_character ///
future_character if female == 0 & sample == 1 using "${Directory}Output/character_rating_male.tex", by(treatment) ///
pcompare latex se count notes(Standard errors clustered at the treatment level.)


ttest motivated_video if (treatment==0|treatment ==1) & female==1 & sample == 1, by(treatment)
ttest motivated_video if (treatment==0|treatment ==2) & female==1 & sample == 1, by(treatment)

ttest motivated_video if (treatment==0|treatment ==1) & female==0 & sample == 1, by(treatment)
ttest motivated_video if (treatment==0|treatment ==2) & female==0 & sample == 1, by(treatment)
	
	

